Integrand size = 21, antiderivative size = 72 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-a^2 x-\frac {a^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d} \]
-a^2*x-a^2*arctanh(sin(d*x+c))/d+a^2*tan(d*x+c)/d+a^2*sec(d*x+c)*tan(d*x+c )/d+1/3*a^2*tan(d*x+c)^3/d
Time = 0.22 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.12 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {a^2 \arctan (\tan (c+d x))}{d}-\frac {a^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d} \]
-((a^2*ArcTan[Tan[c + d*x]])/d) - (a^2*ArcTanh[Sin[c + d*x]])/d + (a^2*Tan [c + d*x])/d + (a^2*Sec[c + d*x]*Tan[c + d*x])/d + (a^2*Tan[c + d*x]^3)/(3 *d)
Time = 0.31 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 4374, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) (a \sec (c+d x)+a)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cot \left (c+d x+\frac {\pi }{2}\right )^2 \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^2dx\) |
\(\Big \downarrow \) 4374 |
\(\displaystyle \int \left (a^2 \tan ^2(c+d x)+a^2 \tan ^2(c+d x) \sec ^2(c+d x)+2 a^2 \tan ^2(c+d x) \sec (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {a^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \tan (c+d x) \sec (c+d x)}{d}-a^2 x\) |
-(a^2*x) - (a^2*ArcTanh[Sin[c + d*x]])/d + (a^2*Tan[c + d*x])/d + (a^2*Sec [c + d*x]*Tan[c + d*x])/d + (a^2*Tan[c + d*x]^3)/(3*d)
3.1.31.3.1 Defintions of rubi rules used
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
Time = 0.80 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.28
method | result | size |
parts | \(\frac {a^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a^{2} \tan \left (d x +c \right )^{3}}{3 d}+\frac {2 a^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(92\) |
derivativedivides | \(\frac {\frac {a^{2} \sin \left (d x +c \right )^{3}}{3 \cos \left (d x +c \right )^{3}}+2 a^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(93\) |
default | \(\frac {\frac {a^{2} \sin \left (d x +c \right )^{3}}{3 \cos \left (d x +c \right )^{3}}+2 a^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(93\) |
risch | \(-a^{2} x -\frac {2 i a^{2} \left (3 \,{\mathrm e}^{5 i \left (d x +c \right )}-6 \,{\mathrm e}^{2 i \left (d x +c \right )}-3 \,{\mathrm e}^{i \left (d x +c \right )}-2\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(106\) |
a^2/d*(tan(d*x+c)-arctan(tan(d*x+c)))+1/3*a^2*tan(d*x+c)^3/d+2*a^2/d*(1/2* sin(d*x+c)^3/cos(d*x+c)^2+1/2*sin(d*x+c)-1/2*ln(sec(d*x+c)+tan(d*x+c)))
Time = 0.30 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.54 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {6 \, a^{2} d x \cos \left (d x + c\right )^{3} + 3 \, a^{2} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, a^{2} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, a^{2} \cos \left (d x + c\right )^{2} + 3 \, a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{3}} \]
-1/6*(6*a^2*d*x*cos(d*x + c)^3 + 3*a^2*cos(d*x + c)^3*log(sin(d*x + c) + 1 ) - 3*a^2*cos(d*x + c)^3*log(-sin(d*x + c) + 1) - 2*(2*a^2*cos(d*x + c)^2 + 3*a^2*cos(d*x + c) + a^2)*sin(d*x + c))/(d*cos(d*x + c)^3)
\[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=a^{2} \left (\int 2 \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )}\, dx\right ) \]
a**2*(Integral(2*tan(c + d*x)**2*sec(c + d*x), x) + Integral(tan(c + d*x)* *2*sec(c + d*x)**2, x) + Integral(tan(c + d*x)**2, x))
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.15 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {2 \, a^{2} \tan \left (d x + c\right )^{3} - 6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} - 3 \, a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \]
1/6*(2*a^2*tan(d*x + c)^3 - 6*(d*x + c - tan(d*x + c))*a^2 - 3*a^2*(2*sin( d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)))/d
Time = 0.62 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.38 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {3 \, {\left (d x + c\right )} a^{2} + 3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {4 \, {\left (a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \]
-1/3*(3*(d*x + c)*a^2 + 3*a^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*a^2*l og(abs(tan(1/2*d*x + 1/2*c) - 1)) - 4*(a^2*tan(1/2*d*x + 1/2*c)^3 - 3*a^2* tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^3)/d
Time = 13.35 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.40 \[ \int (a+a \sec (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {\frac {4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}-4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-a^2\,x \]